package com.smedi.ismedi.inmail.core.infrastructure.constant;

public enum ProjectTypeEnum {
    S("S",16),
    A("A",14),
    B("B",7),
    C("C",7),
    D("D",5);


    private String type;

    private int count;

    ProjectTypeEnum(String type,int count){
        this.type = type;
        this.count = count;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public static int getCount(String type){
        for(ProjectTypeEnum c : ProjectTypeEnum.values()){
            if(c.getType().equals(type)){
                return c.count;
            }
        }
        return 0;
    }

    public static int getCount(String type,String epcType){
        if(epcType.equals("CONSORTIUM")){
            if("A".equals(type)){
                return 5;
            }
            if("B".equals(type)){
                return 4;
            }
        }else {
            for(ProjectTypeEnum c : ProjectTypeEnum.values()){
                if(c.getType().equals(type)){
                    return c.count;
                }
            }
        }
        return 0;
    }
}
